package com.djl.server.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @program: yebweb
 * @description: 公共的返回对象
 * @author: Mr.dai
 * @create: 2021-08-06 11:51
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RespBean {
    private long code;
    private String message;
    private Object obj;

    /**
     * 成功返回结果
     * @param message
     * @return
     */
    public static RespBean success(String message){
        return  new RespBean(200,message,null);
    }

    /**
     * 成功返回结果
     * @param message
     * @return
     */
    public static RespBean success(String message,Object obj){
        return  new RespBean(200,message,obj);
    }

    /**
     * 失败返回的结果
     * @param message
     * @return
     */
    public static RespBean error(String message){
        return  new RespBean(500,message,null);
    }
    /**
     * 失败返回的结果
     * @param message
     * @return
     */
    public static RespBean error(String message,Object obj){
        return  new RespBean(500,message,obj);
    }
}
